package com.softstao.guoyu.mvp.presenter.me;

import com.softstao.guoyu.model.me.AuditApplyCondition;
import com.softstao.guoyu.model.me.AuditDetail;
import com.softstao.guoyu.model.me.AuditInfo;
import com.softstao.guoyu.mvp.interactor.me.AuditInteractor;
import com.softstao.guoyu.mvp.presenter.BasePresenter;
import com.softstao.guoyu.mvp.viewer.BaseViewer;
import com.softstao.guoyu.mvp.viewer.me.AuditAddViewer;
import com.softstao.guoyu.mvp.viewer.me.AuditDetailViewer;
import com.softstao.guoyu.mvp.viewer.me.AuditInfoViewer;
import com.softstao.guoyu.mvp.viewer.me.CancelApplyViewer;

/**
 * Created by vaikus on 2017/6/15.
 */

public class AuditPresenter extends BasePresenter<BaseViewer,AuditInteractor> {
    public void getAuditInfo(int agentId){
        interactor.getAuditInfo(agentId,o -> ((AuditInfoViewer)viewer).getResult((AuditInfo) o));
    }

    public void addAudit(AuditApplyCondition condition){
        interactor.addAudit(condition,o -> ((AuditAddViewer)viewer).addResult(o));
    }

    public void getAuditDetail(int agentId, int processId){
        interactor.getAuditDetail(agentId,processId,o -> ((AuditDetailViewer)viewer).getResult((AuditDetail) o));
    }

    public void cancel(int agentId, int processId){
        interactor.cancel(agentId,processId,o -> ((CancelApplyViewer)viewer).cancelResult(o));
    }
}
